import request from "./request";
// 登录
export const loginApi = (params) => request.post("/api/login", params);
// 注册
export const regApi = (params) => request.post("/api/reg", params);
// 发布文章
export const addPassageApi = (params) => request.post("/api/article", params);
// 显示文章
export const showPassageApi = () => request.post("/api/articleadd");
// 删除文章
export const deletePassageApi = (params) => request.post("/api/articledelete", params);
// 恢复文章
export const recoverPassageApi = (params) => request.post("/api/articlerecover", params);
// 文章详情
export const getArticleById = (params) =>request.post("/api/articleById",params);
// 分类
export const getCategoryById = (params) =>request.post("/api/categoryById",params); 
// search
export const searchApi = (params) =>request.post("/api/search",params);
// tag
export const getTagBytag = (params) =>request.post("/api/tagBytag",params);
// show tag
export const showTagApi = () => request.post("/api/tagadd");
// 评论
export const addCommentApi = (params) => request.post("/api/comment", params);
// 获取每篇文章的评论
export const getCommentApi = (params) => request.post("/api/getComment", params);
// 获取所有评论
export const getAllCommentApi = () => request.post("/api/getAllComment");
// 评论审查
export const checkCommentApi = (params) => request.post("/api/checkComment", params);
// 新建文章分类
export const addCategoryApi = (params) => request.post("/api/category", params);
// 显示文章分类
export const showCategoryApi = () => request.post("/api/categoryadd");
// 删除文章分类
export const deleteCategoryApi = (params) => request.post("/api/categorydelete", params);
// 点赞
export const addLikeApi = (params) => request.post("/api/like", params);
// 获取点赞数
export const getLikeApi = (params) => request.post("/api/getLike", params);
// 数点赞数前五的文章
export const getTopLikeApi = () => request.post("/api/getTopLike");
  // 将count的值储存到mysql数据库中
export const addCountApi = (params) => request.post("/api/count", params);